<template>
  <div class="home">
    <!-- <div style="width:375px;overflow: hidden;"> -->
    <swiper :lunbolist="lunbolist"></swiper>
    <gird></gird>
  </div>
</template>
<script>
import gird from "../../components/gird";
import swiper from "../../components/swiper";
export default {
  data() {
    return {
      lunbolist: []
    };
  },
  created() {
    this.getlunbolist();
  },
  methods: {
    // getlunbolist() {
    //   this.$http.get("api/getlunbo").then(results => {
    //     const {
    //       data: { status, message }
    //     } = results;

    //     if (status === 0) {
    //       this.lunbolist = message;
    //     } else {
    //       Toast("请求轮播图数据失败");
    //     }
    //   });
    // }

    async getlunbolist() {
      const {
        data: { status, message }
      } = await this.$http.get("api/getlunbo");

      if (status === 0) {
        this.lunbolist = message;
      } else {
        Toast("请求轮播图数据失败");
      }
    }
  },
  components: {
    gird,
    swiper
  }
};
</script>
<style lang="less">
.home {
}
</style>